#include "Button\button.h"

RndButton::RndButton()
{
	BtnX = BtnY = 0;
	IsLineActive = false;
	IsLinePlaying = false;
}

sf::Shape RndButton::GetBtn()
{

	return RndBtn;
}

void RndButton::Create(int x, int y)
{
	BtnX = x;
	BtnY = y;

	RndBtn = sf::Shape::Circle(sf::Vector2f(0, 0), 33.0f, sf::Color(17, 17, 17), 2.0f, sf::Color(255, 255, 255));

	RndBtn.SetPosition(x, y);
}

void RndButton::Draw(sf::RenderWindow &App, FMOD::System *system)
{
	const sf::Input& Input = App.GetInput();

	UpdateBtn();
	App.Draw(GetBtn());
}

sf::Shape RndButton::UpdateBtn()
{
	/*if (!IsLineActive && !IsLinePlaying)
		RndBtn = sf::Shape::Circle(sf::Vector2f(BtnX,BtnY), 33.0f, sf::Color(17,17,17), 2.0f, sf::Color(255,255,255));*/

	if (IsLineActive)
	{
		RndBtn = sf::Shape::Circle(sf::Vector2f(BtnX,BtnY), 33.0f, sf::Color(17, 17, 17), 2.0f, sf::Color(255, 222, 0));

		if (IsLinePlaying)
			RndBtn = sf::Shape::Circle(sf::Vector2f(BtnX,BtnY), 33.0f, sf::Color(43, 169, 0), 2.0f, sf::Color(43, 169, 0));
	}
	else
		RndBtn = sf::Shape::Circle(sf::Vector2f(BtnX,BtnY), 33.0f, sf::Color(17,17,17), 2.0f, sf::Color(255,255,255));

	return RndBtn;
}